package com.burges.net.dataStream.codeRuler.transform.MultiDataStream

import org.apache.flink.streaming.api.scala.{SplitStream, StreamExecutionEnvironment, _}

/**
  * 创建人    BurgessLee 
  * 创建时间   2020/1/26 
  * 描述
  */
object SplitDemo {

	def main(args: Array[String]): Unit = {
		val environment = StreamExecutionEnvironment.getExecutionEnvironment
		//创建数据集
		val dataStream1 = environment.fromElements(("a",3), ("d", 4), ("c", 2), ("e", 5))
		//合并两个数据集
		val splitStream: SplitStream[(String, Int)] = dataStream1.split(t => if(t._2 % 2 == 0) Seq("even") else Seq("odd"))

		splitStream.print()
		environment.execute("streaming split operator")

	}

}
